//
//  ApprenticListCell.m
//  PPDL
//
//  Created by 王洋 on 2019/8/23.
//  Copyright © 2019 王洋. All rights reserved.
//

#import "ApprenticListCell.h"

@implementation ApprenticListCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)fillCellWithModel:(ApprenticeModel *)model {
    
    self.itemTime.text = [NSString stringWithFormat:@"%@",model.itemTime];
    self.itemApprenticeName.text = [NSString stringWithFormat:@"%@",model.itemApprenticeName];
    self.itemCoinStatus.text = [NSString stringWithFormat:@"%@",model.extracted?@"已摘取":@"未摘取"];
    self.itemTime.text = [NSString stringWithFormat:@"%@",model.itemTime];
    
    [self.itemCoinBtn setTitle:[NSString stringWithFormat:@"%@",model.acquirableMoney] forState:UIControlStateNormal];
    
    UIColor *color;
    if (model.extracted) {
        color = UIColorHex(0xde9239);
    } else {
        color = UIColorHex(0xffffff);
    }
    
    [self.itemCoinBtn setTitleColor:color forState:UIControlStateNormal];
    
    [self.itemCoinBtn setBackgroundImage:[UIImage imageNamed:model.extracted?@"tudi_income_yellow":@"tudi_income_gray"]
                                forState:UIControlStateNormal];
}

@end
